package cn.bandeqing.user.entity;

import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import cn.bandeqing.user.req.UserSaveOrUpdateReq;
import cn.bandeqing.user.req.UserUpdateBasicReq;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 实体类。
 *
 * @author fugui
 * @since 2023-11-20
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "sys_user", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMappers({
        @AutoMapper(target = UserSaveOrUpdateReq.class, convertGenerate = false),
        @AutoMapper(target = UserUpdateBasicReq.class, convertGenerate = false)
})
public class User extends BaseEntity {

    /**
     * 用户自增ID
     */
    @Id(keyType = KeyType.Auto)
    private Long usId;

    /**
     * 用户编码 xx00001
     */
    private String usUuid;

    /**
     * 用户昵称
     */
    private String usNickName;

    /**
     * 用户真实姓名
     */
    private String usRealName;

    /**
     * 用户登录名
     */
    private String usLoginName;

    /**
     * 用户登录密码
     */
    private String usPassword;

    /**
     * 用户密码加盐
     */
    private String usPasswordSalt;

    /**
     * 用户类型 0=本部 1=城市运营商 2=店铺
     */
    private UsType usType;

    /**
     * 用户状态 0=正常 1=冻结
     */
    private UsStatus usStatus;

    private String usHeadImgUrl;

    private String usEmail;

    private String usDesc;

    private String usPhone;

    private String usAddress;

    private Boolean superAdmin;

}
